<?php	namespace Common\Model;
use Hdphp\Model\Model;
class User extends Model
{
	protected $table = 'user';
	protected $validate = array(
		/*array('yname','required','账号不能为空',3,3),
		array('nickname','required','账号不能为空',3,3),	
		array('yhpassword','required','账号不能为空',3,3),
		array('mailbox','email','邮箱错误',3,3),
		array('Address','required','账号不能为空',3,3),
		array('Phone','phone ','手机输入错误',3,3),
		array('mobile','tel','电话输入错误',3,3),	*/
	);
	public function store()
	{
		if(!$this->create()) return false;
		$_POST['yhpassword'] = md5($_POST['yhpassword']);
		if($_POST['Code'] != $_SESSION['code'])
		{
			return View::error('验证码错误');
		}
		$data = array(
			'yname'=>$_POST['yname'],
			'nickname'=>$_POST['nickname'],
			'yhpassword'=>$_POST['yhpassword'],
			'mailbox'=>$_POST['mailbox'],
			'Address'=>$_POST['Address'],
			'Phone'=>$_POST['Phone'],
			'mobile'=>$_POST['mobile']
		);
		return $this->add($data);
	}
}
